<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewpor" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./vue.global.js"></script>
</head>

<body>
    <div id="app">

        <!-- 防抖处理：等到用户的输入告一段落(敲回车或者将光标定位到别处) 时才同步一次数据 -->
        <input type="text" v-model.lazy="message">
        <br>

        <!-- 帮用户裁剪头尾的空格 -->
        <input type="text" v-model.trim="message">
        <br>

        <!-- 将用户的输入转换为number类型 -->
        <input type="text" v-model.number="age">
        <br>

        <span>message: {{message}}</span>
        <br>
        <span>age: {{age}}/{{ageType}}</span>
    </div>

    <script>
        Vue.createApp({
            data(){
                return {
                    message:"yes",
                    age:18
                }
            },
            computed:{
                ageType(){
                    return typeof(this.age) 
                }
            }
        }).mount('#app')
    </script>
</body>

</html>